<script setup lang="ts">
import { ref } from "vue";
import zhCN from "ant-design-vue/es/locale/zh_CN";
import { useThemeStore } from "@/store/theme.ts";
import { storeToRefs } from "pinia";
const locale = ref(zhCN);
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
dayjs.locale("zh-cn");

const themeStore = useThemeStore();
const { colorTheme } = storeToRefs(themeStore);
</script>

<template>
  <a-config-provider
    :locale="locale"
    :theme="{
      token: {
        colorPrimary: colorTheme,
        colorLink: colorTheme,
        colorLinkHover: colorTheme,
      },
    }"
  >
    <RouterView />
  </a-config-provider>
</template>
